package com.qf.bigdata.service.impl;

import com.qf.bigdata.bean.RawSQLResult;
import com.qf.bigdata.repository.ClickHouseQuery;
import com.qf.bigdata.service.UserLabelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("userLabelService")
public class UserLabelServiceImpl  implements UserLabelService {
    @Autowired
    @Qualifier("clickHouseQuery")
    private ClickHouseQuery clickHouseQuery;

    @Override
    public RawSQLResult queryLabelByUid(String uid) {
        RawSQLResult result=new RawSQLResult();
        result.setCode(200);
        result.setMsg("ok");
        result.setData(clickHouseQuery.queryLabelByUid(uid));
        return result;
    }

    @Override
    public RawSQLResult queryUsersByLabel(List<List> andList, List<List> orList, String op) {
        RawSQLResult result=new RawSQLResult();
        result.setCode(200);
        result.setMsg("ok");
        result.setData(clickHouseQuery.queryUsersByLabel(andList,orList,op));
        return result;
    }
}
